package com.traffic.repository.trafficline;


import com.traffic.entity.TrafficCar;
import com.traffic.entity.TrafficLine;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;


/**
 * @Author :
 * @Description :
 * @Date : create in 13:41 2017/6/21
 * @Modify by :
 */
@Repository
@Transactional
public interface TrafficLineRepository extends JpaRepository<TrafficLine, Long> {


   Page<TrafficLine> findAllByLine(String line, Pageable pageable);
 List<TrafficLine> findAllByLine(String line);
    Page<TrafficLine>   findAllByStartroad(String road, Pageable pageable);

    Page<TrafficLine>   findAllByStartroadAndEndroad(String startroad, String endroad, Pageable pageable);

    Page<TrafficLine>   findAllByLineOrStartroadOrEndroad(String line,String startroad, String endroad, Pageable pageable);

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    TrafficLine findById(Long id);
}